Skip to content

fix(refacto-codebase): technical docs & sub folders#869

Open
aeppling wants to merge 37 commits intomasterfrom
develop
Open

fix(refacto-codebase): technical docs & sub folders#869
aeppling wants to merge 37 commits intomasterfrom
develop

Conversation

@aeppling
Copy link
Copy Markdown
Contributor

Summary

Part 1 of codebase refacto for better onboarding, cleaner code for an extensible and collaborative codebase

tobwen and others added 20 commits March 20, 2026 06:51
Fixes #613 - psql flags like -h, -U, -d, -c were being interpreted
as rtk options instead of being forwarded to psql. By disabling the
automatic help flag, psql's own flags can pass through correctly.

Users can still access psql help via 'rtk psql --help'.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: zerone0x <hi@trine.dev>
- codebase more clear for humans and AI agents
- alignement on vision and filter quality in technical docs
Signed-off-by: Ахмедов Нурбек Медетбаевич <n.akhmedov@uzdc.uz>
feat(refacto-codebase-onboarding): partie 1 - folders and technical docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rtk ls | wc -l returned N+2 instead of N because the summary line
(📊 X files, Y dirs) and blank line were always written to stdout.

Now uses std::io::stdout().is_terminal() to suppress the summary
when piped, following standard Unix convention (ls, grep, find all
do this).

Fixes #482

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
Avoids one allocation since entries is not used after the if/else.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
Fixes Documentation Validation CI check (main.rs=64, ARCHITECTURE.md was 60).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
Signed-off-by: Roopesh <roopesh1724989@gmail.com>
cat flags like -v, -A, -e, -t, -s have different semantics than
rtk read flags (-v means verbose, -n means line numbers). Blindly
forwarding flags caused incorrect behavior (e.g. cat -A file →
rtk read -A file which fails).

Only skip rewrite for incompatible flags. cat -n (line numbers) maps
correctly to rtk read -n, so it is still rewritten for token savings.
Plain `cat file` continues to rewrite to `rtk read file` as before.
Copy link
Copy Markdown
Collaborator

@pszymkowiak pszymkowiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — PR #869: Codebase refactoring (Part 1)

What it does

Major reorganization of the Rust codebase into a cleaner structure:

  • src/*.rs flat files → organized into submodules:
    • src/analytics/ — cc_economics, ccusage, gain, session_cmd
    • src/cmds/ — grouped by ecosystem (cloud, dotnet, git, go, js, python, ruby, rust, system)
  • hooks/ — organized by IDE (claude, cline, codex, copilot, cursor, opencode)
  • Docs updated: ARCHITECTURE.md, CLAUDE.md, CONTRIBUTING.md, TECHNICAL.md

Stats

  • 100 files changed, 56 Rust files
  • No logic changes — pure file moves + mod.rs wiring
  • CI: 17/17 checks passing

Assessment

LGTM. This is a clean structural refactor:

  • ✅ Ecosystem-based grouping makes sense (git, js, rust, python, etc.)
  • ✅ Analytics separated from commands
  • ✅ Hooks organized by IDE/tool
  • ✅ All CI passing
  • ✅ Docs updated to match new structure

Minor concerns

  • The src/cmds/ split means new contributors need to know which ecosystem a filter belongs to — the CONTRIBUTING.md update addresses this
  • Make sure cargo doc still generates correctly with the new module paths
  • Part 2 should probably move core/ (tracking, config, filter, tee, utils) as mentioned in ARCHITECTURE.md

No blockers. Ready to merge.

aeppling and others added 8 commits March 27, 2026 19:17
As of go v1.24, tools such as golanci-lint can be managed via the mod
file and called directly on the go binary via the tool subcommand.

When called via tools, we now apply the same logic to compact the
results as in the directly called command.

Signed-off-by: shwoop <monkey.mambo.al.ferguson@gmail.com>
fix(ls): suppress summary line when stdout is piped
LGTM. Correct fix — Clap's command graph can overflow the default 1MB Windows stack. /STACK:8388608 is a standard mitigation.
Docs correct — branch names use slash prefixes, not conventional-commit format in parentheses.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 28, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
9 out of 12 committers have signed the CLA.

✅ aeppling
✅ sveitser
✅ zerone0x
✅ ousamabenyounes
✅ mvanhorn
✅ FlorianBruniaux
✅ yogasw
✅ shwoop
✅ MauroDeryckere
❌ Ахмедов Нурбек Медетбаевич
❌ tobwen
❌ TechWizard9999


Ахмедов Нурбек Медетбаевич seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

FlorianBruniaux and others added 9 commits March 28, 2026 01:48
Correct fix. UTC timestamps in a local CLI history view is a UX bug — chrono::Local is already a dependency.
Correct fix. disable_help_flag = true is the right pattern for passthrough commands — consistent with other commands in the codebase.
…n-cargo-output

Correct. The Finished line carries useful signal (build time + profile). Defensive implementation with Option fallback.
Standard portability fix. /bin/bash is not guaranteed on NixOS or macOS with Homebrew bash. /usr/bin/env bash is the correct practice.
…or-details

LGTM after code review. truncate() correctly imported, error_details block placed before rule frequency table, test covers the main case. Minor duplication for error[Exxxx] style but not a bug.
Correct fix. cat flags like -A/-v/-e have no rtk read equivalent — skipping rewrite is the right behavior. cat -n correctly preserved. Well tested.
feat(go): Support golangci-lint via go tool
fix(security): salt device hash for telemetry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.